package week7;
import java.util.*;

interface IntegerStack1{
	public void push(Character item);
	public void pop(); 
	public Character peek(); 
	public boolean empty(); 
	public int size(); 

}

class Stack implements IntegerStack1{
	List<Character> stack = new LinkedList<Character>();
	@Override
	public void push(Character item) {
		stack.add(item);
	}

	@Override
	public void pop() {
		stack.remove(stack.size()-1);
	}

	@Override
	public Character peek() {
		return stack.get(stack.size()-1);
	}

	@Override
	public boolean empty() {
		return stack.isEmpty();
	}

	@Override
	public int size() {
		return stack.size();
	}
	
}

public class Main201421123042 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in 

 

);
		Stack stack = new Stack();
		boolean flag = true;
		String str = sc.next();
		char[] ch = str.toCharArray();
		for(char e:ch){
			stack.push(e);
		}
		for(int i=0;i<stack.size();i++){
			if(ch[i]!=stack.peek()){
				flag=false;
				break;
			}
			stack.pop();
		}
		System.out.println(flag);
		
		sc.close();
		

	}

}